package cn.net.ecode.constant;

/**
 * @ClassName SendSmsTypeEnum
 * @Description 发送短信类型，可用于redis组装key
 * @Author AlanShelby
 * @Date 2019/8/26 0026 16:23
 * @Version 1.0
 */
public enum SendSmsTypeEnum {
    REGISTER(1001, "注册"),
    LOGIN(1002, "登录");

    private Integer code;

    private String message;

    SendSmsTypeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer value) {
        if (value == null) {
            return "";
        } else {
            for (SendSmsTypeEnum ms : SendSmsTypeEnum.values()) {
                if (ms.getCode() == value) {
                    return ms.getMessage();
                }
            }
            return "";
        }
    }
}
